<template>
  <div>
    <el-table v-loading="loading" border :data="dataSource" highlight-current-row :height="autoHeight">
      <el-table-column prop="ruleVal" label="规则值" align="center"></el-table-column>
      <el-table-column prop="wordVal" label="关键值" align="center"></el-table-column>
      <el-table-column prop="ruleMax" label="最大值" align="center"></el-table-column>
      <el-table-column prop="updateAt" label="更新日期" align="center"></el-table-column>
    </el-table>
    <div class="lab-table-page">
      <div style="display: inline-flex">
        <el-pagination
            :disabled="loading"
            :current-page="pageInfo.page"
            :page-sizes="[5, 10, 15, 20, 50, 100]"
            :page-size="pageInfo.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="pageInfo.total"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
        />
        <el-button-group style="padding: 2px 5px">
          <el-button icon="el-icon-refresh" title="刷新" :disabled="loading" @click="loadSource([])" />
        </el-button-group>
      </div>
    </div>
  </div>
</template>

<script>
import IdeaTable from "@/mixins/IdeaTable";
import IdeaCode from "@/components/idea-code/IdeaCode";

export default {
  name: "AppMaxTable",
  components: {IdeaCode},
  mixins: [IdeaTable],
  props: {
    select: {
      type: Boolean,
      default: false
    },
    modelRule: {
      type: Object,
      default: function () {
        return { ruleId: '0' }
      }
    }
  },
  computed:{
    autoHeight() {
      return `calc(100vh - 240px)`
    }
  },
  created() {
    this.queryUrl = '/ruleMax/queryPage'
    this.saveUrl = '/ruleMax/save'
    this.removeUrl = '/ruleMax/delete/'
    this.rowKey = 'maxId'
    this.pageInfo.pageSize = 10
    this.addFilter({field: 'ruleId',op: '=', value: this.modelRule.ruleId })
    this.loadSource()
  }
}
</script>

<style scoped>

</style>
